package gui;

import java.awt.Dimension;

import javax.swing.JPanel;

import sop.Main;

import net.miginfocom.layout.CC;
import net.miginfocom.swing.MigLayout;

public class Template extends JPanel {
    private static Template instance = null;
    
    public static Template getInstance() {
        if(instance == null) {
            instance = new Template();
        } 
        return instance;
    }
    
	MigLayout layout  = new MigLayout();
	static JPanel rightColumn = new JPanel();
	
	private Template() {
		System.out.println("Tworze template");
		setLayout(layout);
		
		
		synchronized (this.getTreeLock()) {
		      PageWelcome pageWelcome = PageWelcome.getInstance();
		      pageWelcome.setVisible(true);
		      rightColumn.add(pageWelcome); 
		}

		if(login.kto()==true){
		synchronized (this.getTreeLock()) {
		     PagePracownicy pagePracownik = PagePracownicy.getInstance();
		     pagePracownik.setVisible(false);
		     rightColumn.add(pagePracownik);
		}
		}
		synchronized (this.getTreeLock()) {
	        PageZadanie pageZadanie = PageZadanie.getInstance();
	        pageZadanie.setVisible(false);
	        rightColumn.add(pageZadanie);
       }
		
		add(new MenuLeft(), new CC().width("100px"));

		 
		 
		
		//rightColumn.add(PagePracownik.getInstance()); 
		
		rightColumn.setSize(new Dimension(400,600));
		add(rightColumn);
	}

}
